<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>全名(计算属性)</title>
</head>

<body>
    <h1>全名(计算属性)</h1>
    <p style="color: gray;">
    app.firstName = "Tom"
    app.lastName = "Jack"
    </p>
    <div>
        <a href="/">回目录</a>
    </div>
    <hr>
    <div id="app">
        <div>First Name : {{ firstName }}</div>
        <div>Last Name : {{ lastName }}</div>
        <div>Full Name  : {{ fullName }}</div>
    </div>
    <script src="/node_modules/vue/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                firstName: "Vue",
                lastName: "js",
            },
            computed: {
                fullName : function() {
                    return this.firstName + "." + this.lastName;
                }
            }
        });
    </script>
</body>

</html>